import { GET as get, POST as post } from '../axios.config.js'

const base = config.ip
const projectName = '/rcdg-record'

// 查询分管和直管机构
export const getUserChargeOrgDetail = p => post(`${base}${projectName}/sa-record-note/getUserChargeOrgDetail`, p)

// 查询机构下人员
export const listUserDetailByOrgId = p => post(`${base}${projectName}/sa-record-note/listUserDetailByOrgId`, p)

// 根据代码类型查询对应的代码表
export const queryCodeInfo = p => post(`${base}${projectName}/code-public/queryCodeInfo`, p)

// 保存纪实信息(周/月)
export const addBackNote = p => post(`${base}${projectName}/record-base/add`, p)

// 获取(周/月)纪实详情
export const getRecordNoteDetails = p => post(`${base}${projectName}/sa-record-note/getRecordNoteDetails`, p)

// 获取(季)纪实详情
export const getRecordNoteSeasonDetails = p =>
  post(`${base}${projectName}/sa-record-note/getRecordNoteSeasonDetails`, p)

// 退回季度工作总结
export const returnQuarterRecord = p => post(`${base}${projectName}/record-base/returnQuarterRecord`, p)

// 催报-迭代
export const saveUrgeDataNew = p => post(`${base}${projectName}/record-base/saveUrgeNew`, p)

// 问题反馈保存
export const addRecordProblem = p => post(`${base}${projectName}/record-base/addRecordProblem`, p)

export const addRecordProblemLoading = p =>
  post(`${base}${projectName}/record-base/addRecordProblem`, p, {
    headers: {
      hideLoading: true,
    },
  })

// 纪实模板是否展示
// 查询 recordType
export const selectUserRememberTips = p => get(`${base}${projectName}/common-bus/selectUserRememberTips`, p)

// 关闭 recordType
export const addUserRememberTips = p =>
  get(`${base}${projectName}/common-bus/addUserRememberTips`, p, {
    headers: {
      hideLoading: true,
    },
  })

// 收藏为个人纪实条目模板
export const collectNoteTemplateInfo = p => post(`${base}${projectName}/record-template/collectNoteTemplateInfo`, p)
// 删除纪实条目模板
export const delNoteTemplateInfo = p => post(`${base}${projectName}/record-template/delNoteTemplateInfo`, p)
// 查询工作纪实条目模板列表
export const queryNoteTemplateList = p => get(`${base}${projectName}/record-template/queryNoteTemplateList`, p)

// 根据代码类型查询对应的代码表
export const queryRoleCodeInfo = p => post(`${base}${projectName}/code-public/queryRoleCodeInfo`, p)

// 记录填写纪实的方式（最后一次打开方式）
export const rememberWriteRecordTips = p => get(`${base}${projectName}/common-bus/rememberWriteRecordTips`, p)
// 获取上次纪实填写的方式
export const getRememberWriteRecordTips = p => get(`${base}${projectName}/common-bus/getRememberWriteRecordTips`, p)

/** *********************** 考核登记表 *************************/
// 查询登记详情信息
export const getFormByNoteId = p => post(`${base}${projectName}/form-evaluation/getFormByNoteId`, p)
// 保存/暂存登记详情
export const saveForm = p => post(`${base}${projectName}/form-evaluation/saveForm`, p)

// 获取季度总结
export const getRecordDetailByPeriod = p => post(`${base}${projectName}/record-base/v2/getRecordDetailByPeriod`, p)

// 保存纪实信息(季)
export const addRecordNoteSeason = p => post(`${base}${projectName}/record-base/v2/addRecordNoteSeason`, p)
export const addRecordNoteSeasonLoading = p =>
  post(`${base}${projectName}/record-base/v2/addRecordNoteSeason`, p, {
    headers: {
      hideLoading: true,
    },
  })

// 获取周纪实
export const getWeekRecordForm = p => post(`${base}${projectName}/record-base/v2/getWeekRecordForm`, p)

// 保存|暂存 周工作纪实信息
export const addRecordNoteWeek = p => post(`${base}${projectName}/record-base/v2/addRecordNoteWeek`, p)

// 检查是否可提交纪实(周&月)
export const checkSubmitRecord = p => post(`${base}${projectName}/record-base/v2/checkSubmitRecord`, p)

// 2查询月小结详情信息
export const getMonthRecordForm = p => post(`${base}${projectName}/record-base/v2/getMonthRecordForm`, p)

// 2保存月小结纪实信息
export const addRecordNoteMonth = p => post(`${base}${projectName}/record-base/v2/addRecordNoteMonth`, p)

// V2查询前一个周月季总结
export const getLastRecordFormThisId = p => post(`${base}${projectName}/record-base/v2/getLastRecordFormThisId`, p)

// 获取看纪实机构和人员列表
export const getlistOrganRecordNotes = p => post(`${base}${projectName}/record-base/v2/listOrganRecordNotes`, p)

// 获取看纪实列表
export const getlistRecordNoteCalendarV2 = p => post(`${base}${projectName}/record-base/v2/listRecordNoteCalendarV2`, p)

// V2获取看纪实机构列表
export const getlistLookOrgan = p => post(`${base}${projectName}/record-base/v2/listLookOrgan`, p)

// V2获取看纪实人员列表
export const getlistLookUser = p => post(`${base}${projectName}/record-base/v2/listLookUser`, p)

// 查询本年季度纪实标题
export const listQuarterRecordTitles = p => get(`${base}${projectName}/record-base/listQuarterRecordTitles`, p)

// 保存年度个人|部门纪实信息
export const addRecordNoteYear = p => post(`${base}${projectName}/record-base/addRecordNoteYear`, p)

// 查询填报页信息年度总结
export const getTemplateByCode = p => post(`${base}/rcdg-agile-table/template/getTemplateByCode`, p)

// 查询年度登记详情信息
export const getYearRecordForm = p => post(`${base}${projectName}/record-base/getYearRecordForm`, p)

// 保存年度登记详情信息
export const saveYearRecordForm = p => post(`${base}${projectName}/record-base/saveYearRecordForm`, p)

// 导出年度考核文档
export const exportYearRecord = p => `${base}${projectName}/record-base/skipValidation/exportYearRecord${p}`

// 保存上级纪实退回信息
export const saveReturn = p => post(`${base}${projectName}/record-base/saveReturn`, p)

// 保存上级纪实答复信息
export const saveSuggest = p => post(`${base}${projectName}/record-base/saveSuggest`, p)
